package com.example.demo.service;

import com.example.demo.domain.Elder;
import com.example.demo.mapper.ElderMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ElderServiceImpl implements ElderService{
    @Autowired
    private ElderMapper elderMapper;

    @Override
    public int addElder(Elder elder) {
        return elderMapper.InsertElder(elder);
    }

    @Override
    public int deleteElder(Integer id) {
        return elderMapper.DeleteElder(id);
    }

    @Override
    public Elder selectElder(Integer elder_id) {
        return elderMapper.SelectElder(elder_id);
    }

    @Override
    public int updateElder(Elder elder) {
        return elderMapper.UpdateElder(elder);
    }

    @Override
    public List<Elder> findAll() {
        return elderMapper.SelectAll();
    }

    @Override
    public int selectAge(Integer min, Integer max) {
        return elderMapper.SelectAge(min, max);
    }
}
